package com.action;


import com.service.BaiduMapService;
import com.vo.NearFriend;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@CrossOrigin("*")
public class BaiduMapAction {

    @Autowired
    private BaiduMapService baiduMapService;


    @RequestMapping("/nearFriend")
    public List<NearFriend> nearFriend(double x, double y)
    {
        String me = "me";//要从登录的用户名中获取
        baiduMapService.addData(me,x,y);
        return baiduMapService.nearFriend(me,50*1000,10);

    }




}
